﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AsyncPersistence.Entities
{
    public abstract class PersistableEntity
    {
        #region Fields
        public static long Ticks = DateTime.Now.Ticks;
        #endregion

        #region Properties
        public long Id { get; set; }
        protected DateTime? LastModification { get; set; }
        public DateTime CreationDateTime { get; set; }
        #endregion

        #region Constructors
        /// <summary>
        /// NHibernate constructor
        /// </summary>
        public PersistableEntity() { }

        /// <summary/>
        /// <param name="newId"></param>
        public PersistableEntity(long newId)
        {
            Id = newId;
            CreationDateTime = DateTime.Now;
        }
        #endregion
    }
}
